package com.triones.api.service.interlace;

import com.triones.api.entity.interlace.bo.request.ListAllBalancesRequest;
import com.triones.api.entity.interlace.dto.InterlaceBalancesDO;
import com.triones.api.entity.interlace.dto.InterlaceQuantumTransferDO;

import java.math.BigDecimal;

/**
 * interlace 共有方法
 */
public interface InterlaceCommunalService {

    /**
     * 更新余额
     * @param request
     */
    void updateBalances(ListAllBalancesRequest request);

    /**
     * 更新主账户余额
     * @param request
     */
    void updateMasterBalances(ListAllBalancesRequest request);

    /**
     * 检查账户余额 true：余额足够、false：余额不足
     * @param dto
     * @param expenditure
     * @return
     */
    Boolean checkBalances(InterlaceBalancesDO dto, BigDecimal expenditure);

    /**
     * 添加 量子账户交易记录
     * @param quantumTransferDO
     * @return
     */
    InterlaceQuantumTransferDO addQuantumTransfer(InterlaceQuantumTransferDO quantumTransferDO);

    /**
     * 更新子主加密钱包
     * @param subAccountId 子账户id
     * @param currency 币种
     * @param amount 增减数量
     * @param type: increase 增加、decrease：减少
     */
    void updateCryptoWallet(String subAccountId, String currency, BigDecimal amount, String type);
}
